package routers

import (
	"github.com/gorilla/mux"
	"mw/handler"
	"mw/middeware"
)

func RegisterRouters(r *mux.Router) {
	r.Use(middeware.Logging()) //全局应用
	userRouter := r.PathPrefix("/user").Subrouter()
	userRouter.HandleFunc("/index", handler.UserIndex)
	userRouter.Use(middeware.Method("GET")) //给子路由器应用
}
